home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
UTILREEN
/
BITFNT38.LZH
/
BITFNT38.DOC
next >
Wrap
Text File
|
1988-06-02
|
25KB
|
482 lines
BITFNT38, Copyright 1988 by Bruce J. Patin. All rights reserved.
This DOC file and the associated EXE and BFC files may be freely
distributed.
Bitfont is a program which can be used to design or modify fonts of
bit-mapped characters. Using a configuration file as a template,
font files for a wide variety of printers and graphics programs
can be read in, modified by Bitfont, then written out to a new file.
Bitfont itself has graphics capabilities to display characters
with either discrete or overlapping dots, and there are many
menu-driven functions which can be used to quickly modify entire
fonts.
A configuration file must be created for each font file format,
using what is actually a simple programming language.
The rules of this programming language are given later on in this
document. A sample configuration file is HPLAJET2.BFC,
which can be used to read and write fonts compatible with the
Hewlett Packard LaserJet II printer.
Another sample file is NLQDRAFT.BFC, which can be used with the
NLQ printer, which is supposed to be compatible with the Epson FX-85.
It is possible to design and save individual characters without
a configuration file, by writing the bit pattern to the file in hex
or in the form of a matrix of 1's and 0's or X's and spaces.
The desired form can be selected from the Save or Load displays.
To execute Bitfont, simply type in the name of the EXE file, BITFNT38.EXE.
If there is a configuration file by the name of BITFONT.BFC in the
current directory, this will automatically be loaded.
If not, you will need to select CF on the Parameter Display to
specify and load in a configuration file in order to read and write
fonts. When you select a configuration file to be loaded, BITFNT38
will read it in, condense it, write it to the current directory as
BITFONT.BFC, and then reread it from BITFONT.BFC in its condensed form.
This makes future invocations of BITFNT38 faster.
The menus of the Bitfont program should be self-explanatory, with
possibly a little experimentation. Mouse support for the design screen
has not yet been implemented, but should be unnecessary for most
purposes, since the cursor keys and surrounding keys and menu commands
are very effectively implemented for the purpose of designing characters.
Bitfont has been written in Turbo Pascal 4.0.
The source code is available for $120.
For answers to any questions or a copy of the source code, send a note
to:
Bruce J. Patin
4225 N. Henderson Drive #101
Arlington, VA 22203
Sorry, I do not accept phone calls.
*************************************************************************
I/O Configuration File:
This file is composed of entries for each field of the font file.
Each configuration entry is composed of one or more subfields,
separated by commas. The configuration entry is ended by a semicolon.
The entire set of configuration entries is ended by a period.
There may be more than one set of configurations in a file.
They are identified by an ID and Name in the Start Config entry.
The first subfield is the Type and optional Modifier.
Other possible subfields are Termination, Termchar, Length, Start,
Varid, Name, String, all explained as follows.
Note that the format of an entry may vary, depending on
whether it is used for input (load) or output (save).
Comments and whitespace may be included anywhere in the
configuration file. Comments must be enclosed in curly brackets.
If the very first character is an asterisk (*), then it is
assumed that the whitespace and comments are removed (compacted).
When a configuration file is first loaded in, it is automatically
saved in bitfont.bfc in the compacted form, so that next time
bitfont is started, the most recent configuration loaded will be
quickly and efficiently loaded automatically.
*************************************************************************
The format of each entry in the configuration file is given as follows
in parentheses, according to the type of entry.
(Do not include the parentheses when actually coding the configuration.)
In general, the entry type is indicated by the first character in the
entry.
Section Types: (in the order in which they should be used)
N - start configuration set initialization. (N:Name;)
Only assignments (types A,T,X) may occur between N and E.
E - end initialization section.
KI - start input font header.
EI - end input font header.
L1 - label 1 (see below for labels) to indicate start of character.
ESL - end character search, character loaded.
(ignored if loading entire font)
KT - start input font trailer.
ET - end input font trailer.
KS - start character search program, to search for an input character.
This is needed for loading in a selected character only.
Routine here should contain a jump to L1.
ESU - end character search program (unsuccessful search)
KO - start output font header.
EO - end output font header.
KC - start output character, for when character is being appended.
EC - end output character.
KZ - start output font trailer.
EZ - end output font trailer.
KP - start download.
EP - stop download.
. - a period after the last semicolon ends the configuration set.
Diagnostic types:
# - (#:Varid,Message;) sends Message and value of Varid to terminal.
#R - Same as #, but waits for you to hit return.
#A - Sends Message and waits for you to enter a value to assign to Varid.
$ - Same as #, except any value is displayed and entered in hex.
(the value is limited to FF, one byte's worth)
Branching types:
Zn - Set length limit.
(Zn:Length;) Length is a value expression.
After each configuration entry, the number of bytes read from
the font input file is checked, and a skip to label n is done
if the number of bytes transferred from the font file, after Zn,
is equal to or greater than Length, at which time the length
limitation is reset.
R - Reset length limit;
Ln - label n. n is a decimal number, maximum value of 99.
Jn - Jump on condition to label n.
n may be a value expression, allowing for a "computed goto".
(Jn:Value1,Operator,Value2;)
Operator may be:
GT - Greater than.
LT - Less than.
EQ - Equal to.
GE - Greater than or equal to.
LE - Less than or equal to.
NE - Not equal to.
Assignment types:
A - Assignment only. (A:Varid=Value,Name;)
A maximum of 128 variables, including predetermined can be assigned.
T - Assignment of a string of text characters to a variable.
There may be a maximum of 8 of these.
The Text must be enclosed in double quotes.
(T:Varid=Text,Name;)
X - Assignment of an optional variable for which each character
descriptor has its own value. (X:Varid=Value,Name;)
There may be a maximum of 6 of these, none of which may be strings.
All variables of this type must be assigned with X before they
can be used elsewhere.
P - Position input font file at Value position. (P:Value;)
C - Code select (C;); used only during save operations.
This selects the variables and data for the character having
a code equal to the previously set value of CC.
If CC is not a valid code, then the next higher code is selected.
If there is no valid higher code, CC is set to 0.
G - the character bit data string. (G:Start,Length;)
Start and Length are optional Value expressions.
The default is the entire string, of length calculated
using the currently assigned width, height and data format.
For counting purposes, the first data byte is byte 0.
'G' may have an optional modifier 'H', 'D' or 'B' to indicate that
bytes are expressed in hex, decimal, or binary, and the additional
submodifier 'S' may be used to indicate that the hi and lo order
bytes of each pair of bytes is to be swapped.
If modifiers H or B are selected for load, all non-hex or non-binary
characters are ignored. For a save operation, the hex or binary
digits are not separated from each other in any way.
If modifier D is selected, all characters are ignored during load except
for decimal values, which are each expected to represent a value of
one byte of data, and are each separated by any non-decimal
character. During save, each byte value is separated by a space.
If it is desired to write commas instead of spaces between bytes,
use modifier C in place of D.
For load operations, Type G saves the string into a data area
constructed according to the previously set character values
for the character code specified in the previously set CC Varid.
Also, any previously set values of character variables are
associated with that data area.
For save operations, Type G or saves the string for the character
which has been previously selected by a code select, Type C.
The following entry types are as used in input (load) operations.
The type corresponds to data from the font file.
S - Signed byte. (S:Varid,Name;)
U - Unsigned byte. (U:Varid,Name;)
I - Integer (signed 2-bytes) (I:Varid,Name;)
W - Word (unsigned 2-bytes) (W:Varid,Name;)
Hn - Hexadecimal characters. (Hn:Varid,Name;)
Characters are skipped until a hexadecimal character is encountered.
The number is ended when a non-hexadecimal character is encountered,
or when a maximum of n hexadecimal characters is read.
Submodifier S may be used in place of n, in which case the
maximum number of characters read is set to 4.
n should not be greater than 4, the default.
Bn - Binary characters. (Bn:Varid,Name;)
Any characters are skipped until a 1 or 0 character is found.
The number is ended when a character other than a 1 or 0 is
encountered, or when a maximum of n binary characters is read.
Submodifier S may be used in place of n, in which case the
maximum number of characters read is set to 16.
n should not be greater than 16, the default.
Dn - Decimal characters. (Dn:Varid,Name;)
Characters are skipped until a decimal character is encountered.
The number is ended when a non-decimal character is encountered,
or when a maximum of n decimal characters are read.
n should not be greater than 8, the default.
Q - Text character(s). A string of characters is read until terminated
by a termination character or a length. Both may be specified,
in which case, the string is ended whichever occurs first.
(Q:Varid,Termchar,Length,Name;).
Termchar is specified in hex, preceded by a dollar sign.
If not given, code the comma. The default is $1b (Escape).
Length is a value expression. If not given, code the comma.
The maximum and default for length is 127.
The resulting string does not include the Termchar, which will
be the next byte read by the next configuration entry.
The following entry types are as used in output (save) operations.
The type corresponds to data as it will be put into the font file.
S - Signed byte. (S:Value;)
U - Unsigned byte. (U:Value;)
I - Integer (signed 2-bytes) (I:Value;)
W - Word (unsigned 2-bytes) (W:Value;)
Hn - Hexadecimal characters. (Hn:Value;)
Value is converted and saved into the font file as a string of
hex characters, until n number of characters or a maximum
of 4 hex characters is reached.
Bn - Binary characters. (Bn:Value;)
Value is converted and saved into the font file as a string of
0 and 1 characters, until n number of characters or a maximum
of 16 binary characters is reached.
D - Decimal characters. (D:Value,Width;)
Value is converted and written to the font file as a decimal number.
Width is an optional value expression giving the minimum number
of characters to be used to express the decimal number.
If omitted, only as many characters as necessary are output.
If fewer characters are necessary than specifed in Width,
spaces are added to the beginning of the number to make up the
width.
Y - text, added as is into the font file. (Y:Text;)
Text must be enclosed in double quotes.
Q - Text string, previously assigned by either type T or Q.
(Q:Varid,Start,Length;) Start and Length are optional value
fields which can be used to save a sub-string.
*************************************************************************
The optional modifier 'S' may immediately follow any of the type codes
I,W,H,B to indicate that the high and low order bytes
of every pair of bytes is swapped.
*************************************************************************
"Varid" is a two character variable name, of which the first
character must be alphabetic. Some variables are predetermined
by Bitfont. Additional variables and their values
may be freely assigned by the user in the configuration file.
The values of variables may be either integers or character strings.
Once a value is assigned, a Varid may be used in any subsequent
value expression.
Predetermined Varids are:
FH - Font cell height, maximum height of a character in the font.
FW - Font cell width, maximum width of a character in the font.
BL - Baseline distance, distance from top of cell to a reference line.
OO - (letters, not numbers) Font Overall Orientation.
(0=portrait, 1=landscape)
AA - Indicates whether horizontally adjacent dots are allowed.
AA = 0 means adjacent dots are not allowed.
AA = 1 means adjacent dots are allowed (normal).
FI - Input font file name, including the path, if any needed.
FO - Output font file name, including the path, if any needed.
CF - Configuration file name. (cannot be used)
FP - File Position, current byte of file, starting at 0.
FS - File Size. (FP and FS are only available for examination.)
PR - Printer device.
QP - The Palette to use for Design screen, if using an IBM CGA.
Q0 - Background color on the design screen.
Q1 - Color of borders, pin points and text on the design screen.
Q2 - Color of the character dot on the design screen.
Q3 - Color of the pen icon on the design screen.
(Following variables have separate values for each selected character:)
CC - Character code.
CW - Width of character in dots.
CH - Height of character in dots.
DL - The total length of the bit data string.
DC - The length of data actually loaded in the bit data string.
DF - Format of character bit data.
DF = 1 is Laser or CRT format.
DF = 2 is Wire Matrix format.
DF = 3 is Wire Matrix format, separated by passes.
PW - Number of print head wires used.
XD - Horizontal Graphics Print Density.
XD = 1 is single, draft density.
XD = 2 is double density.
XD = 4 is quad density.
YD - Number of overlapping print head passes. Normal is 1 pass.
(Vertical density)
OR - Orientation (0=portrait, 1=landscape)
LO - Left offset, distance in dots from left edge of font cell to
left edge of character.
TO - Top offset, distance in dots from baseline to top edge of
character.
*************************************************************************
"Length" is a value, and may be:
- explicitly defined in decimal.
- explicitly defined as $ followed by hexadecimal number.
- a value expression.
*************************************************************************
"Name" is an optional character string, and if given, is displayed
and used for prompting for values on the specifications screen.
*************************************************************************
"Value" may be:
- a previously assigned Varid.
- a decimal number.
- a one or two byte hexadecimal number, preceded by a $.
- an expression, using any of the above and integer operators + - * /
Note that a value expression is strictly evaluated left to right,
not using the normal algebraic rules in which * and / have precedence.
Parentheses are not allowed; however, complicated expressions may
be implemented by using extra Assignment statements and creating
your own temporary variables.
If a Varid use has not been assigned, the value used for that Varid
is zero. If a Varid has been assigned to Text, then the value
used for that Varid is the length of the Text.
*************************************************************************
Here are some examples showing the of correspondence of dots
to bytes and bits of a character data string.
In the sample arrays, each dot is represented by byte.bit,
where the first byte is byte 0, and the most significant bit is bit 7.
*************************************************************************
In the Laser or CRT data format, a character of width 12 dots,
height 10 dots is as follows:
0.7 0.6 0.5 0.4 0.3 0.2 0.1 0.0 1.7 1.6 1.5 1.4
2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 3.7 3.6 3.5 3.4
4.7 4.6 4.5 4.4 4.3 4.2 4.1 4.0 5.7 5.6 5.5 5.4
6.7 6.6 6.5 6.4 6.3 6.2 6.1 6.0 7.7 7.6 7.5 7.4
8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0 9.7 9.6 9.5 9.4
10.7 10.6 10.5 10.4 10.3 10.2 10.1 10.0 11.7 11.6 11.5 11.4
12.7 12.6 12.5 12.4 12.3 12.2 12.1 12.0 13.7 13.6 13.5 13.4
14.7 14.6 14.5 14.4 14.3 14.2 14.1 14.0 15.7 15.6 15.5 15.4
16.7 16.6 16.5 16.4 16.3 16.2 16.1 16.0 17.7 17.6 17.5 17.4
18.7 18.6 18.5 18.4 18.3 18.2 18.1 18.0 19.7 19.6 19.5 19.4
*************************************************************************
In the Wire Matrix format, one pass printing, a character 8 dots high
and 12 dots wide would be as follows:
0.7 1.7 2.7 3.7 4.7 5.7 6.7 7.7 8.7 9.7 10.7 11.7
0.6 1.6 2.6 3.6 4.6 5.6 6.6 7.6 8.6 9.6 10.6 11.6
0.5 1.5 2.5 3.5 4.5 5.5 6.5 7.5 8.5 9.5 10.5 11.5
0.4 1.4 2.4 3.4 4.4 5.4 6.4 7.4 8.4 9.4 10.4 11.4
0.3 1.3 2.3 3.3 4.3 5.3 6.3 7.3 8.3 9.3 10.3 11.3
0.2 1.2 2.2 3.2 4.2 5.2 6.2 7.2 8.2 9.2 10.2 11.2
0.1 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 11.1
0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0
*************************************************************************
In the Wire Matrix format, one pass printing, a character 10 dots high
and 12 dots wide would be as follows:
0.7 2.7 4.7 6.7 8.7 10.7 12.7 14.7 16.7 18.7 20.7 22.7
0.6 2.6 4.6 6.6 8.6 10.6 12.6 14.6 16.6 18.6 20.6 22.6
0.5 2.5 4.5 6.5 8.5 10.5 12.5 14.5 16.5 18.5 20.5 22.5
0.4 2.4 4.4 6.4 8.4 10.4 12.4 14.4 16.4 18.4 20.4 22.4
0.3 2.3 4.3 6.3 8.3 10.3 12.3 14.3 16.3 18.3 20.3 22.3
0.2 2.2 4.2 6.2 8.2 10.2 12.2 14.2 16.2 18.2 20.2 22.2
0.1 2.1 4.1 6.1 8.1 10.1 12.1 14.1 16.1 18.1 20.1 22.1
0.0 2.0 4.0 6.0 8.0 10.0 12.0 14.0 16.0 18.0 20.0 22.0
1.7 3.7 5.7 7.7 9.7 11.7 13.7 15.7 17.7 19.7 21.7 23.7
1.6 3.6 5.6 7.6 9.6 11.6 13.6 15.6 16.6 19.6 21.6 23.6
*************************************************************************
In the Wire Matrix format, one pass printing, using 8 wires,
and separated by passes, a character 10 dots high
and 12 dots wide would be as follows:
0.7 1.7 2.7 3.7 4.7 5.7 6.7 7.7 8.7 9.7 10.7 11.7
0.6 1.6 2.6 3.6 4.6 5.6 6.6 7.6 8.6 9.6 10.6 11.6
0.5 1.5 2.5 3.5 4.5 5.5 6.5 7.5 8.5 9.5 10.5 11.5
0.4 1.4 2.4 3.4 4.4 5.4 6.4 7.4 8.4 9.4 10.4 11.4
0.3 1.3 2.3 3.3 4.3 5.3 6.3 7.3 8.3 9.3 10.3 11.3
0.2 1.2 2.2 3.2 4.2 5.2 6.2 7.2 8.2 9.2 10.2 11.2
0.1 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 11.1
0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0
12.7 13.7 14.7 15.7 16.7 17.7 18.7 19.7 20.7 21.7 22.7 23.7
12.6 13.6 14.6 15.6 16.6 17.6 18.6 19.6 20.6 21.6 22.6 23.6
*************************************************************************
In the Wire Matrix format, two pass printing, using 8 wires,
and separated by passes, a character 19 dots high
and 12 dots wide would be as follows:
0.7 1.7 2.7 3.7 4.7 5.7 6.7 7.7 8.7 9.7 10.7 11.7
12.7 13.7 14.7 15.7 16.7 17.7 18.7 19.7 20.7 21.7 22.7 23.7
0.6 1.6 2.6 3.6 4.6 5.6 6.6 7.6 8.6 9.6 10.6 11.6
12.6 13.6 14.6 15.6 16.6 17.6 18.6 19.6 20.6 21.6 22.6 23.6
0.5 1.5 2.5 3.5 4.5 5.5 6.5 7.5 8.5 9.5 10.5 11.5
12.5 13.5 14.5 15.5 16.5 17.5 18.5 19.5 20.5 21.5 22.5 23.5
0.4 1.4 2.4 3.4 4.4 5.4 6.4 7.4 8.4 9.4 10.4 11.4
12.4 13.4 14.4 15.4 16.4 17.4 18.4 19.4 20.4 21.4 22.4 23.4
0.3 1.3 2.3 3.3 4.3 5.3 6.3 7.3 8.3 9.3 10.3 11.3
12.3 13.3 14.3 15.3 16.3 17.3 18.3 19.3 20.3 21.3 22.3 23.3
0.2 1.2 2.2 3.2 4.2 5.2 6.2 7.2 8.2 9.2 10.2 11.2
12.2 13.2 14.2 15.2 16.2 17.2 18.2 19.2 20.2 21.2 22.2 23.2
0.1 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1 10.1 11.1
12.1 13.1 14.1 15.1 16.1 17.1 18.1 19.1 20.1 21.1 22.1 23.1
0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0
12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0
24.7 25.7 26.7 27.7 28.7 29.7 30.7 31.7 32.7 33.7 34.7 35.7
36.7 37.7 38.7 39.7 40.7 41.7 42.7 43.7 44.7 45.7 46.7 47.7
24.6 25.6 26.6 27.6 28.6 29.6 30.6 31.6 32.6 33.6 34.6 35.6
*************************************************************************
And if you still haven't gotten the idea, and wish to be even more
confused, in the Wire Matrix format, three pass printing, using 9 wires,
and separated by passes, a character 28 dots high and 12 dots wide
would be as follows: (Needless to say, I did not key these in by hand.)
0.7 2.7 4.7 6.7 8.7 10.7 12.7 14.7 16.7 18.7 20.7 22.7
24.7 26.7 28.7 30.7 32.7 34.7 36.7 38.7 40.7 42.7 44.7 46.7
48.7 50.7 52.7 54.7 56.7 58.7 60.7 62.7 64.7 66.7 68.7 70.7
0.6 2.6 4.6 6.6 8.6 10.6 12.6 14.6 16.6 18.6 20.6 22.6
24.6 26.6 28.6 30.6 32.6 34.6 36.6 38.6 40.6 42.6 44.6 46.6
48.6 50.6 52.6 54.6 56.6 58.6 60.6 62.6 64.6 66.6 68.6 70.6
0.5 2.5 4.5 6.5 8.5 10.5 12.5 14.5 16.5 18.5 20.5 22.5
24.5 26.5 28.5 30.5 32.5 34.5 36.5 38.5 40.5 42.5 44.5 46.5
48.5 50.5 52.5 54.5 56.5 58.5 60.5 62.5 64.5 66.5 68.5 70.5
0.4 2.4 4.4 6.4 8.4 10.4 12.4 14.4 16.4 18.4 20.4 22.4
24.4 26.4 28.4 30.4 32.4 34.4 36.4 38.4 40.4 42.4 44.4 46.4
48.4 50.4 52.4 54.4 56.4 58.4 60.4 62.4 64.4 66.4 68.4 70.4
0.3 2.3 4.3 6.3 8.3 10.3 12.3 14.3 16.3 18.3 20.3 22.3
24.3 26.3 28.3 30.3 32.3 34.3 36.3 38.3 40.3 42.3 44.3 46.3
48.3 50.3 52.3 54.3 56.3 58.3 60.3 62.3 64.3 66.3 68.3 70.3
0.2 2.2 4.2 6.2 8.2 10.2 12.2 14.2 16.2 18.2 20.2 22.2
24.2 26.2 28.2 30.2 32.2 34.2 36.2 38.2 40.2 42.2 44.2 46.2
48.2 50.2 52.2 54.2 56.2 58.2 60.2 62.2 64.2 66.2 68.2 70.2
0.1 2.1 4.1 6.1 8.1 10.1 12.1 14.1 16.1 18.1 20.1 22.1
24.1 26.1 28.1 30.1 32.1 34.1 36.1 38.1 40.1 42.1 44.1 46.1
48.1 50.1 52.1 54.1 56.1 58.1 60.1 62.1 64.1 66.1 68.1 70.1
0.0 2.0 4.0 6.0 8.0 10.0 12.0 14.0 16.0 18.0 20.0 22.0
24.0 26.0 28.0 30.0 32.0 34.0 36.0 38.0 40.0 42.0 44.0 46.0
48.0 50.0 52.0 54.0 56.0 58.0 60.0 62.0 64.0 66.0 68.0 70.0
1.7 3.7 5.7 7.7 9.7 11.7 13.7 15.7 17.7 19.7 21.7 23.7
25.7 27.7 29.7 31.7 33.7 35.7 37.7 39.7 41.7 43.7 45.7 47.7
49.7 51.7 53.7 55.7 57.7 59.7 61.7 63.7 65.7 67.7 69.7 71.7
72.7 74.7 76.7 78.7 80.7 82.7 84.7 86.7 88.7 90.7 92.7 94.7
*************************************************************************